package ca.llsutherland.nfl.exception;

import java.text.MessageFormat;

public class PoolMessage {

    protected String message;

    public PoolMessage(String message) {
        this.message = message;
    }
    
    public String getMessage() {
        return message;
    }

    public void setMessage(String string) {
        message = string;
    }

    public String getRenderedMessage() {
        StringBuilder sb = new StringBuilder();
        sb.append(getMessageFormat(message));
        return sb.toString();
    }

    private static MessageFormat getMessageFormat(String message) {
        return new MessageFormat(message);
    }

    @Override
    public String toString() {
        return this.message;
    }

    @Override
    public int hashCode() {
        return this.getRenderedMessage().hashCode();
    }
}
